import {
  provide,
  defineComponent,
  Slot,
  VNodeProps,
  ref,
  Teleport,
  nextTick,
} from 'vue'
declare type InternalSlots = {
  [name: string]: Slot | undefined
}
export default (
  props: VNodeProps,
  { attrs, slots }: { attrs: Record<string, unknown>; slots: InternalSlots }
) => {
  console.log(slots, attrs.getContainer)
  let container = 'body'
  if (typeof attrs.getContainer === 'function') {
    // container = attrs.getContainer()
    console.log(attrs.getContainer)
  }
  return (
    <>
      {container ? (
        <Teleport to={container}>{slots.default && slots.default()}</Teleport>
      ) : null}
    </>
  )
}
